package validation

type PiplineRun struct {
	ProjectId int `json:"project_id" form:"project_id" binding:"required"` // 项目ID (必传)
	CID       int `json:"c_id" form:"c_id" binding:"required"`             // 构建计划ID (必传)
}

type PiplineStop struct {
	ProjectId int `json:"project_id" form:"project_id" binding:"required"`
	CID       int `json:"c_id" form:"c_id" binding:"required"`
	BuildID   int `json:"build_id" form:"build_id" binding:"required"`
}

type GetPipline struct {
	ProjectId int `json:"project_id" form:"project_id" binding:"required"` // 项目ID (必传)
	CID       int `json:"c_id" form:"c_id" binding:"required"`             // 构建计划ID (必传)
	BuildID   int `json:"build_id" form:"build_id" binding:"required"`     // 构建记录ID (必传)
}

type GetAllPipline struct {
	ProjectId int `json:"project_id" form:"project_id" binding:"required"` // 项目ID (必传)
	CID       int `json:"c_id" form:"c_id" binding:"required"`             // 构建计划ID (必传)
	Page      Page
}

type GetStage struct {
	ProjectId int    `json:"project_id" form:"project_id" binding:"required"` // 项目ID (必传)
	BuildID   int    `json:"build_id" form:"build_id" binding:"required"`     // 构建计划ID (必传)
	CiName    string `json:"ci_name" form:"ci_name" binding:"required"`       // 构建计划名称 (必传)
}

type GetStageSimple struct {
	BuildIDs []int `json:"build_ids" form:"build_ids" binding:"required"` // 构建计划ID数组 (必传)
}

type GetStageInfo struct {
	FlowID int `json:"flow_id" form:"flow_id" binding:"required"` // 步骤ID
}

type GetTestReport struct {
	BuildID int `json:"build_id" form:"build_id" binding:"required"` // 构建记录ID()
}

type DownloadArtifact struct {
	Path string `json:"path" form:"path" binding:"required"` // 文件路径
	Name string `json:"name" form:"name" binding:"required"` // 文件名称
}

type DeleteBuild struct {
	BuildID int `json:"build_id" form:"build_id" binding:"required"` // 构建记录ID (必传)
}

type GetBuildConsoleOutput struct {
	BuildID int `json:"build_id" form:"build_id" binding:"required"` // 构建记录ID (必传)
}

type GetInputAction struct {
	BuildID int `json:"build_id" form:"build_id" binding:"required"` // 构建记录ID (必传)
}

type InputSubmit struct {
	BuildID int    `json:"build_id" form:"build_id" binding:"required"`  // 构建记录ID (必传)
	Stage   string `json:"stage" form:"stage" binding:"required"`        // 步骤名 (必传)
	Submit  string `json:"submit" form:"submit" binding:"required,bool"` // 操作结果 (必传)
	Name    string `json:"name" form:"name"`                             // 如果有参数，这是参数名字
	Value   string `json:"value" form:"value"`                           // 如果有参数， 这是参数取值
}
